﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Caching;

namespace ECommerce.DAO.Cache.Comunicaciones
{
    public static class Email
    {
        public static ECommerce.Model.Comunicaciones.Email GetEmailById(int ident)
        {
            return (ECommerce.Model.Comunicaciones.Email)ECommerce.DAO.Cache.CacheHelper.GetObjetoById(ident);
        }

        public static void SetEmail(ECommerce.Model.Comunicaciones.Email Email)
        {
            ECommerce.DAO.Cache.CacheHelper.SetObjeto(Email);
        }

        public static void DelEmail(ECommerce.Model.Comunicaciones.Email Email)
        {
            ECommerce.DAO.Cache.CacheHelper.DelObjeto(Email);
        }
        public static void SetEmailsByPersona(ECommerce.Model.Comunicaciones.Email[] Emails, ECommerce.Model.Personas.Persona Persona)
        {
            ECommerce.DAO.Cache.CacheHelper.SetObjetos(Emails, Persona.Id, "EmailsByPersona");
        }
        public static ECommerce.Model.Comunicaciones.Email[] GetEmailsByPersonaId(int IdPersona)
        {
            return (ECommerce.Model.Comunicaciones.Email[])ECommerce.DAO.Cache.CacheHelper.GetObjetos(IdPersona, "EmailsByPersona");
        }
        public static void DelEmailsByPersonaId(int IdPersona)
        {
            ECommerce.DAO.Cache.CacheHelper.DelObjetos(IdPersona, "EmailsByPersona");
        }
    }
}
